home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 March
/
EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso
/
earcd
/
util4
/
noiz.lha
/
noiz.doc
< prev
Wrap
Text File
|
1996-01-16
|
6KB
|
153 lines
NAME
noiz -- a simple package for accumulating and dispensing
cryptographically-strong noise, using MD5 as
a stirring function
ANTICOPYRIGHT
Anticopyright (A) 1995 Henry Strickland <strick@yak.net>
This package is placed this package in the public domain.
Because this package is free, there is no warranty
for it whatsoever. Caveat hacker.
This is alpha-quality software. It seemed to work for
me, but it may not do what I say it does.
The MD5 implementation is by Colin Plumb (1993),
and is also in the public domain.
Amiga Port by C.R. 'Magius' Hahn.
-----------------------------------------------------------------------
Amiga-NOIZ uses the standard AmigaDOS 'ReadArgs' interface.
Template:
FILE/K,TO/K,STIR/S,ASCII/S,INIT/S
Usage:
NOIZ [FILE <noizfile>] [TO <outfile>] [STIR] [ASCII] [INIT]
FILE - The full path of the noise state file. If not given,
the default, "S:noiz" will be used. Noiz also
checks the environment variable, NOIZFILE.
TO - The destination file for output.
STIR - This specifies that NOIZ should 'stir' the state file
before using it.
ASCII - Specifies that output should be in human-readable
form.
INIT - Specifies that the noise state file should be
created and initialized.
NOIZ will always create and initialize S:noiz if it does not
already exist. The INIT switch is therefore not necessary.
NOIZ will never re-initialize S:noiz if it is found to
exist, even if INIT is given.
Once S:noiz is created, it must be stirred several times before
it can be used to produce output. The command, "NOIZ STIR",
entered several times, will accomplish this.
After this is done, random noise can be produced, 16 bytes at
a time, by running NOIZ with no parameters. NOTE: it is
a good idea to 'stir' S:noiz periodically.
There is some interaction between the command-line parameters,
which produces some rather obscure behavior. Specifically,
the 'TO' keyword and the 'ASCII' keyword implicitly instruct
NOIZ to output some random noise. If neither of these are
given on the command line, noiz will produce output only
if neither of 'STIR' or 'INIT' are given. Output will be
binary unless 'ASCII' is given, with the exception that if
'TO' is NOT given, output will be in human readable form,
regardless of whether 'ASCII' was given or not.
Confused yet? Don't worry, it's actually more intuitive
than it sounds.
If the default path, "S:noiz", is undesirable for any reason,
it can be overridden by the contents of the environment
variable, "NOIZFILE". However, the environment variable
will, in turn, be overridden by the 'FILE' keyword on the
command line.
Examples:
NOIZ STIR
- stir S:noiz
NOIZ
- produce 16 bytes human-readable output noise
NOIZ ASCII STIR
- stir S:noiz and then produce 16 bytes human-readable
output noise
NOIZ TO afile
- produce 16 bytes of noise, and write them to "afile",
in binary form
NOIZ TO bfile ASCII
- produce 16 bytes of noise, and write them to "bfile",
in human-readable form
NOIZ FILE S:morenoiz
- produce 16 bytes human-readable output noise, using
S:morenoiz instead of S:noiz
NOIZ STIR TO cfile
- stir S:noiz and then produce 16 bytes of noise,
written to "cfile" in binary form.
NOTES:
- The original "noizspin" program is not usable under AmigaOS. It
has been replaced by using rand() from the standard C library. As
I know little of the ways of entropy and other mysterious forces 8),
I cannot say what adverse effects this may have on the quality of
the output. (Discretion advised!) rand() is seeded (using srand())
with the XOR of the result of time() and Amiga EXEC FindTask(), which
returns the address (in RAM) of the program's task structure. (Note
that while the task structure is not guaranteed to reside at a
different address on each invokation of NOIZ, nor is it guaranteed
to reside at the same address. The value returned by FindTask() will
depend heavily on how much RAM your system has, what OS revision you
have, and what other program or programs you are running or have run
previous to running NOIZ - this includes anything introduced by your
startup-sequence, user-startup, or WBStartup.)
- The original noiz uses the pid and ppid in stirring and generating
output. As these do not exist under AmigaOS, I have replaced pid
with a result from rand(), and ppid with the result of FindTask().
Note that while the return of FindTask() is not particularly
unpredictable between successive calls, it is much less predictable
between machines (everyone has their system configured just a bit
differently), which is part of the reason why I have used it.
- NOIZ is pure and may be made resident, so if the archiving process
has screwed up the protection bits, you may set the P bit now.
- The AmigaDOS 'version' command will report noiz as version 0.5,
even though "version zero" is not normal practice under AmigaOS.
Why? - Because calling it "V1.0" or whatever would only create
headaches for all of us.
For more information, see the docs from the original noiz-0.5 package,
by Henry Strickland <strick@yak.net> (noiz_orig.doc)